#include "CTimer.h"

CTimer::CTimer(void)
{
	Reset();
}

CTimer::~CTimer()
{
}

void CTimer::Sleep(int ms)
{
	DWORD dwTime = GetTickCount();
	while ( dwTime + ms > GetTickCount());
}

void CTimer::Reset()
{
	mdw_TimeStart = 0;
	mdw_TimeEnd = 0;
}

//set methods
//
void CTimer::SetTimeStart(DWORD time)
{
	mdw_TimeStart = time;
}

void CTimer::SetTimeEnd(DWORD time)
{
	mdw_TimeEnd = time;
}

//get methods
//
DWORD CTimer::GetTime(void)
{
	return GetTickCount();
}

DWORD CTimer::Elapsed(void)
{
	return (DWORD) (mdw_TimeEnd - mdw_TimeStart);
}

DWORD CTimer::GetTimeStart()
{
	return mdw_TimeStart;
}

DWORD CTimer::GetTimeEnd()
{
	return mdw_TimeEnd;
}


